package com.avic.modules.equipment.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.sql.Timestamp;

/**
 * @author zhangzikang 设备运行记录表
 * @date 2022-08-14
 */
@Data
@TableName("equipment_operation")
@NoArgsConstructor
public class EquipmentOperation implements Serializable {

    // 运行id
    private String id;

    // 运行设备
    private String equipId;

    // 运行状态
    private Integer runningState;

    // 运行时长
    private Long second;

    // 运行时间
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp createTime;

    public void copy(EquipmentOperation source) {
        BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
